package com.training.menu.service.impl.chengshu;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import com.training.imenu.chengshu.IMenu;
import com.training.menu.service.chengshu.IMenuService;
import com.training.pojo.chengshu.UFunction;

public class MenuServiceImpl implements IMenuService {
	private IMenu menuimpl;
	
	public void setMenuimpl(IMenu menuimpl) {
		this.menuimpl = menuimpl;
	}
	public List<UFunction> menuService(Integer uid) {
		List<UFunction> uflist = new ArrayList<UFunction>();
		uflist = menuimpl.queryModule(uid);
		uflist = menuimpl.removemenu(uflist);
		return uflist;
	}
	public Map<String, List<UFunction>> menuListService(List<UFunction> uflist,Integer uid) {
		Map<String, List<UFunction>>  map = new HashMap<String, List<UFunction>>();
		map = menuimpl.menuList(uflist,2);
		Iterator it = map.entrySet().iterator(); 
		for(;it.hasNext();){
			Map.Entry entry = (Map.Entry) it.next();
			Object key = entry.getKey();
			List<UFunction> value = (List<UFunction>) entry.getValue();
		}
		return map;
	}
	
	
}
